<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html>
<html>

	<head>
		<title>需求详情</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="${ctxStatic }/mui/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="${ctxStatic }/wx/css/pensonal.css" />
	</head>
     <style>
     	html{
     		width: 100%;
     		background: #f5f5f5;
     	}
     	.pay_wechat{
     		background: #fff;
     		padding: 10px 15px;
     		margin-top: 10px;
     		width: 100%;
     		float: left;
     	}
     	.pay_wechat span:nth-child(1){
     		float: left;
     		width: 26px;
     		height: 26px;
     	}
     	.pay_wechat span img{
     		width: 100%;
     	}
     	.pay_wechat  span:nth-child(2){
     		float: left;
     		margin-left: 15px;
     	}
     	.pay_wechat input{
     		float: right;
     		margin-right: 20px;
     		margin-top: 8px;
     	}
     </style>
	<body>
		<div id="customs-d" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav">
				<button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left" style="color: #fff;">
					<span class="mui-icon mui-icon-left-nav"  style="color: #fff;"></span>
				</button>
				<h1 class="mui-center mui-title" style="color: #fff;">预定价格</h1>
			</div>
			<form id="dataForm" action="${ctxWx }/pu/pay/pay/" method="get">
			<input type="hidden" name="orderid" value="${orders.orderid }"/>
			<input type="hidden" name="ordertype" value="${orders.ordertype }"/>
			<input type="hidden" name="payway" value="${payWayType }"/>
			<input type="hidden" name="type" value="" id="typ"/>
			<div class="mui-content">
			<p class="customs-pay-time" ></p>
				<div class="customs-pay">
					 <p class="customs-pay-total">
					 	<span>倒计时</span>
					 	<span id="leftTimeShow">--:--</span>
					 </p>
					 <p class="customs-pay-total">
					 	<span>订单总额</span>
					 	<span>￥${orders.dueamount }</span>
					 </p>
					 <div class="pay-mode">
					 	 <p>支付方式</p>
					 	 <p class="pay_wechat">
					 	 	<span>
					 	 		<!--<img src="images/zhi_jiesuanxinxi@2x.png" />-->
					 	 	</span>

					 	 		<span>微信支付</span>
					 	 		<input type="radio" checked="checked" />

					 	 </p>
					 </div>
					 <div class="pay-md-t">
					 	<button type="button"  id="btn" onclick="check();">确定</button>
					 </div>
				</div>
			</div>
			</form>
		</div>
		<script type="text/javascript" src="${ctxStatic }/zepto/zepto.min.js" ></script>
		<script src="${ctxStatic }/mui/js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init();
			// 锁定倒计时
			var minutes = 0;
			var seconds = 0;
			var x = '${minutes}';
			var y = '${seconds}';
			if(x.length>0){
				minutes = x;
			}
			if(y.length>0){
				seconds = y;
			}
			
			var se  = "";
			Zepto(function() {
				if('${minutes }'>=0){
					se = window.setInterval("leftTimeShow()",1000);
				};
			});
			function isWeiXin(){ 
				var ua = window.navigator.userAgent.toLowerCase(); 
					if (ua.match(/MicroMessenger/i) == 'micromessenger') { 
						return true;
					} else { 
						return false;
					} 
			} 
			function check(){
				if(isWeiXin()){ //微信打开
					$('#dataForm').submit();
				} else{
					$('#typ').val("notwx");
					$('#dataForm').submit();
				}
			}
			function leftTimeShow(){
					var secondsStr = '';
					if(seconds < 10) {
						secondsStr = '0';
					}
					secondsStr += seconds;
					$('#leftTimeShow').text(minutes+':'+secondsStr);
					seconds--;
					if(seconds <= 0) {
						minutes--;
						seconds = 59;
					}
					if(minutes < 0) {
						clearInterval(se);
						//倒计时时间结束
						document.getElementById('btn').disabled = true;
					}
				}
		</script>
	</body>

</html>